﻿using iS3.Server.Core.Util;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iS3.Server.Core.Core
{
    public class ID_Gen
    {
        public static long GetId(WebRequestContext context)
        {
            string configServerUrl = ConfigurationManager.AppSettings["OcelotPath"];

            context.SetBaseURL(configServerUrl);
            return long.Parse(context.Get("api/id/gen").ToString());
        }
        public static List<long> GetIdList(int num, WebRequestContext context)
        {
            string configServerUrl = ConfigurationManager.AppSettings["OcelotPath"];

            context.SetBaseURL(configServerUrl);
            return Newtonsoft.Json.JsonConvert.DeserializeObject<List<long>>(context.Get("api/id/genlist?num="+num).ToString());
        }
    }
}
